package com.iot.rule.api.feign.factory;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import com.iot.rule.api.feign.RemoteRuleService;
import com.iot.rule.api.feign.fallback.RemoteRuleServiceFallbackImpl;

@Component
public class RemoteRuleServiceFallbackFactory implements FallbackFactory<RemoteRuleService>{

	@Override
	public RemoteRuleService create(Throwable throwable) {
		RemoteRuleServiceFallbackImpl remoteRuleServiceFallbackImpl = new RemoteRuleServiceFallbackImpl();
		remoteRuleServiceFallbackImpl.setCause(throwable);
		return remoteRuleServiceFallbackImpl;
	}
}
